def create_bmwk_model():
model = Model()
model.set_var_default(0)
model.var('AF', desc='Amortization funds')
model.var('Cd', desc='Consumption goods demand by households')
model.var('Cs', desc='Consumption goods supply')
model.var('DA', desc='Depreciation allowance')
model.var('K', desc='Stock of capital')
model.var('Kt', desc='Target stock of capital')
model.var('Ld', desc='Demand for bank loans')
model.var('Ls', desc='Supply of bank loans')
model.var('Id', desc='Demand for investment goods')
model.var('Is', desc='Supply of investment goods')
model.var('Mh', desc='Bank deposits held by households')
model.var('Ms', desc='Supply of bank deposits')
model.var('Nd', desc='Demand for labor')
model.var('Ns', desc='Supply of labor')
model.var('Rl', desc='Rate of interest on bank loans')
model.var('Rm', desc='Rate of interest on bank deposits')
model.var('W', desc='Wage rate')
model.var('WBd', desc='Wage bill - demand')
model.var('WBs', desc='Wage bill - supply')
model.var('Y', desc='Income = GDP')
model.var('YD', desc='Disposable income of households')
model.set_param_default(0)
model.param('alpha0', desc='Exogenous component in consumption')
model.param('alpha1r', desc='Propensity to consume out of interest income')
model.param('alpha1w', desc='Propensity to consume out of wage income')
model.param('alpha2', desc='Propensity to consume out of wealth')
model.param('delta', desc='Depreciation rate')
model.param('gamma', desc='Speed of adjustment of capital to its target value')
model.param('kappa', desc='Capital-output ratio')
model.param('PR', desc='Labor productivity')
model.param('Rlbar', desc='Rate of interest on bank loans, set exogenously')
# Basic behavioural equations
model.add('Cs = Cd')
model.add('Is = Id')
model.add('Ns = Nd')
model.add('Ls - Ls(-1) = Ld - Ld(-1)')
model.add('Y = Cs + Is')
model.add('WBd = Y - Rl(-1)*Ld(-1) - AF')
model.add('AF = delta * K(-1)')
model.add('Ld - Ld(-1) = Id - AF')
# Transactions of households
model.add('YD = WBs + Rm(-1)*Mh(-1)')
model.add('Mh - Mh(-1) = YD - Cd')
# Transactions of the banks
model.add('Ms - Ms(-1) = Ls - Ls(-1)')
model.add('Rm = Rl')
# The wage bill
model.add('WBs = W * Ns')
model.add('Nd = Y / PR')
model.add('W = WBd / Nd')
# Household behavior
model.add('Cd = alpha0 + alpha1w*WBs + alpha1r*Rm(-1)*Mh(-1) + alpha2*Mh(-1)')
# The investment beahavior
model.add('K - K(-1) = Id - DA')
model.add('DA = delta * K(-1)')
model.add('Kt = kappa * Y(-1)')
model.add('Id = gamma * (Kt - K(-1)) + DA')
# The behaviour of banks
model.add('Rl = Rlbar')
return model
bmwk_parameters = {'alpha0': 25,
'alpha1r': 0.5,
'alpha1w': 0.75,
'alpha2': 0.1,
'delta': 0.1,
'gamma': 0.15,
'kappa': 1}
bmwk_exogenous = {'PR': 1,
'Rlbar': 0.04}
bmwk_variables = {'Mh': 185.2,
'Ms': 185.2,
'Ld': 185.2,
'Ls': 185.2,
'K': 185.2,
'Y': 185.2,
'Rl': 0.04,
'Rm' : 0.04,
'W': 0.86,
'Cd': 1}